<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>我的二维码</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../plugins/mui/mui.min.css">
		<script src="../../js/statistics.js"></script>
		<style type="text/css">
			 *{
            box-sizing: border-box;
            font-family: 'Microsoft YaHei';
	        }
	        body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, form,  input, p, table, th, td ,select,option{
	            padding: 0;
	            margin: 0;
	            list-style: none;
	        }
	        body{
	        	
	        }
			/*title的样式覆盖*/
			.mui-bar{
				background-color:#43ac45;
			}
			.mui-title{
				color:#fff;
			}
			a.mui-action-back{
				color:#fff;
			}
			.erweima{
				width:100%;
				height:100vh;
				background:#333;
				position:relative
			}
			.main1{
				width:88%;
				height:auto;
				background:#fff;
				margin: 0 auto;
				border-radius: 3px;
				padding: 40px;
				padding-top:19px;
				padding-bottom:19px;
				position:absolute;
				top: 50%;
				left:50%;
				-webkit-transform: translateY(-50%) translateX(-50%);
			}
			.top{
				height:53px;
			}
			.top>img{
				width:53px;
				height:53px;
				float:left;
			}
			.top>div{
				margin-left:26px;
				float:left;
				margin-top:8.5px;
			}
			.top>div>span{
				font-size:16px;
				color:#333;
				line-height: 16px;
				display:inline-block;
			}
			.top>div>b{
				font-size:13px;
				color:#999;
				font-weight: normal;
				line-height: 13px;
				display:block;
			}
			.context1{
				margin-top:15px;
				/*margin-bottom:15px;*/
			}
			.context1>img{
				width:100%;
				height:100%;
			}
			.main1>p{
				font-size: 14px;
				color:#999;
				text-align: center;
				line-height: 25px;
			}
			
			#user-nicheng{
				padding-right:20px;
				background:url('') no-repeat top right;
				background-size:14px 14px;
			}
			.man{
				background-image: url('../../images/my/index/man.png')!important;
			}
			.woman{
				background-image: url('../../images/my/index/woman.png')!important;
			}
		</style>
	</head>
	<body>
		<header class="mui-bar ">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">二维码</h1>
		</header>
		<div class='erweima'>
			<div class='main1'>
				<div class='top'>
					<img src="" alt="" id='mainImage'/>
					<div>
						<span style='margin-bottom:7px;' id='user-nicheng' class='man'></span>
						<b id='city'></b>
					</div>
				</div>
				<div class='context1'>
					<img src="" id='erweima'>
				</div>
				<p>扫描二维码，加我为好友</p>
			</div>
		</div>
		<script type="text/javascript" src='../../plugins/jquery/jquery-3.1.0.min.js'></script>
		<script src="../../plugins/mui/mui.min.js"></script>
		<script src="../../js/getApiToken.js"></script>
		<script src="../../js/md5.js"></script>
		<!--<script type="text/javascript" src="../plugins/mui/update.js"></script>-->
		<script type="text/javascript">
			mui.init({
// 				statusBarBackground: '#43ac45',//ios下设置顶部背景色
	  		});
  			
			mui.plusReady(function(){
			   //关闭等待框
					
				 
				 init();
				//初始化是否有昵称
				function init(){
					if(plus.storage.getItem('cg_headimgurl')){
						$('#mainImage')[0].src=plus.storage.getItem('cg_headimgurl');
					}
					
					
//					else if(plus.storage.getItem('cg_sex')==0||plus.storage.getItem('cg_sex')==1){
//						$('#mainImage')[0].src='../../images/my/index/man.svg';
//					}else{
//						$('#mainImage')[0].src='../../images/my/index/woman.svg';
//					}
					
					//设置性别
					if(plus.storage.getItem('cg_sex')==0||plus.storage.getItem('cg_sex')==1){
							$('#user-nicheng').addClass('man');
					}else{
							$('#user-nicheng').addClass('woman');
					}
					
					
					//设置二维码
					if(plus.storage.getItem('cg_qrcode')){
						$('#erweima')[0].src=_baseUrl+plus.storage.getItem('cg_qrcode');
//						console.log(plus.storage.getItem('cg_qrcode'));
					}
					
					$('#erweima').on('load',function(){
						plus.nativeUI.closeWaiting();
						//显示当前页面
						mui.currentWebview.show('slide-in-right',200);
					})
					
					//设置昵称
					if(plus.storage.getItem('cg_nickname')){
						$('#user-nicheng').html(plus.storage.getItem('cg_nickname'));
					}
					
					//设置城市
					if(plus.storage.getItem('cg_city')){
						$('#city').html(plus.storage.getItem('cg_city').split('|')[1]+' '+plus.storage.getItem('cg_city').split('|')[3]);
					}
				
					
				}
				 
			});
  			
		</script>
	</body>
</html>
